package entities;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The persistent class for the lab_service_detail database table.
 * 
 */
@Entity
@Table(name = "lab_service_detail")
public class LabServiceDetail implements Serializable {
	private static final long serialVersionUID = 1L;
	private int idLabServiceDetail;
	private LabServiceInfo labServiceInfo;
	private String result;
	private ExamineDetail examineDetail;

	public LabServiceDetail() {
	}

	public LabServiceDetail(LabServiceInfo labServiceInfo, String result, ExamineDetail examineDetail) {
		super();
		this.labServiceInfo = labServiceInfo;
		this.result = result;
		this.examineDetail = examineDetail;
	}

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(unique = true, nullable = false)
	public int getIdLabServiceDetail() {
		return this.idLabServiceDetail;
	}

	public void setIdLabServiceDetail(int idLabServiceDetail) {
		this.idLabServiceDetail = idLabServiceDetail;
	}

	@ManyToOne
	@JoinColumn(name = "idLabServiceInfo", nullable = false)
	public LabServiceInfo getLabServiceInfo() {
		return labServiceInfo;
	}

	public void setLabServiceInfo(LabServiceInfo labServiceInfo) {
		this.labServiceInfo = labServiceInfo;
	}

	@Column(nullable = false, length = 200)
	public String getResult() {
		return this.result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	// bi-directional many-to-one association to ExamineDetail
	@ManyToOne
	@JoinColumn(name = "idExamine", nullable = false)
	public ExamineDetail getExamineDetail() {
		return this.examineDetail;
	}

	public void setExamineDetail(ExamineDetail examineDetail) {
		this.examineDetail = examineDetail;
	}

	@Override
	public String toString() {
		return this.getClass().getName() + "[ " + idLabServiceDetail + " | "
				+ labServiceInfo.getIdLabServiceInfo() + " | " + examineDetail.getIdExamine() + " | "
				+ result + " ]";
	}

}